import ormar
from typing import List, Optional
from pydantic import EmailStr

from app.core.db import metadata, database


class Expert(ormar.Model):
    class Meta:
        metadata = metadata
        database = database
        tablename = "experts"


    id: int = ormar.Integer(primary_key=True)
    first_name: str = ormar.String(max_length=32)
    last_name: str = ormar.String(max_length=32)
    patronymic: str = ormar.String(max_length=32)
    position: str = ormar.String(max_length=256)
    education: str = ormar.String(max_length=512)
    experience: int = ormar.Integer()
    # expertises: List[Expertise] = ormar.ForeignKey(Expertise)
    address: str = ormar.String(max_length=256)
    phone_number: str = ormar.String(max_length=20)
    email: Optional[EmailStr] = ormar.String(max_length=512)
    vacation_information: Optional[List[str]] = ormar.String(max_length=2048)
